package com.xiaoxin.xinlikesystem.service;

import com.xiaoxin.xinlikesystem.model.dto.thumb.DoThumbRequest;
import com.xiaoxin.xinlikesystem.model.entity.Thumb;
import com.baomidou.mybatisplus.extension.service.IService;
import jakarta.servlet.http.HttpServletRequest;

/**
 * @author Xiaoxin
 * @description 针对表【thumb(点赞表)】的数据库操作Service
 * @createDate 2025-05-10 14:00:24
 */
public interface ThumbService extends IService<Thumb> {

    /**
     * 点赞
     *
     * @param doThumbRequest 点赞请求
     * @param request        请求
     * @return {@link Boolean }
     */
    Boolean doThumb(DoThumbRequest doThumbRequest, HttpServletRequest request);


    /**
     * 取消点赞
     *
     * @param doThumbRequest 取消点赞请求
     * @param request        请求
     * @return {@link Boolean }
     */
    Boolean undoThumb(DoThumbRequest doThumbRequest, HttpServletRequest request);


    /**
     * 是否点赞
     *
     * @param blogId 博客id
     * @param userId 用户id
     * @return 点赞记录ID
     */
    Long hasThumb(Long blogId, Long userId);


}
